<div class="content">
<h2><?php print $this->ingredient->name; ?></h2>
<p>Gehe direkt zu <a href="#recipes-list">Cocktailrezepten</a> und 
<a href="#products-list">Produkten</a>.</p>
<h3>Zutateninformationen (Durchschnittswerte)</h3>
<?php if($this->ingredient->getIngredientCategories()) {?>
<p><span class="pink">Kategorie:</span>
<?php
if(is_array($this->ingredient->getIngredientCategories())){
	foreach($this->ingredient->getIngredientCategories() as $category){ ?>
	<a href="<?php print $this->url(array('id'=>$category->getUniqueName(),
		'controller'=>'ingredient-category')); ?>?format=mobile"><?php print $category->name; ?></a>
<?php } ?>
<?php } ?></p><?php 
} ?>
<?php if($this->ingredient->description) {?>
<div class="attribut">Beschreibung:</div>
<div class="wert"><?php print $this->ingredient->description; ?></div>
<?php } ?>
<?php if($this->ingredient->getAverageAlcoholLevel()) {?>
<p><span class="pink">Alkoholgehalt:</span>
<?php print $this->ingredient->getAverageAlcoholLevel(); ?>&nbsp;%</p>
<?php } ?>
<?php if($this->ingredient->getAverageCaloriesKcal()) {?>
<p><span class="pink">Kalorien:</span>
<?php print round($this->ingredient->getAverageCaloriesKcal()/10); ?>&nbsp;kcal / 100g bzw. 100 ml</p>
<?php } ?>
<?php if($this->ingredient->getAveragePricePerLitre() || $this->ingredient->getAveragePricePerKilogram()) {?>
<p><span class="pink">Preis:</span>
<?php 
if($this->ingredient->getAveragePricePerLitre()) { 
	print number_format($this->ingredient->getAveragePricePerLitre(),2,',','.'); ?> €&nbsp;/&nbsp;Liter <?php
}
if($this->ingredient->getAveragePricePerLitre() && $this->ingredient->getAveragePricePerKilogram()) {
	print '<br />';
}
if($this->ingredient->getAveragePricePerKilogram()) {
	print number_format($this->ingredient->getAveragePricePerKilogram(),2,',','.'); ?>&nbsp;€&nbsp;/&nbsp;kg <?php 
} ?></p>
<?php } ?>
<?php if($this->ingredient->getAverageWeightGram()) {?>
<p><span class="pink">Gewicht pro Einheit:</span>
<?php print $this->ingredient->getAverageWeightGram(); ?>&nbsp;g</p>
<?php }
if($this->recipes) {?>
<h3 style="margin-bottom: 1.7em;" id="recipes-list">Cocktailrezepte mit <?php print $this->ingredient->name; ?></h3>
<div><?php
if(is_array($this->recipes)){
	$count = 0;
	foreach ($this->recipes as $recipe) { 
		if($count%2==0) { ?><div style="clear: both;"></div><?php } 
		$this->cocktailPreview($recipe); ?>
	<?php
		$count++; 
	}
} ?></div>
<?php }
$products = Website_Model_Product::productsByIngredientId($this->ingredient->id);
if($products) { ?>
<h3 id="products-list"><?php print $this->ingredient->name; ?> Produkte</h3>
<div><?php
if(is_array($products)){ ?>
<ul class="no-bullet" style="margin-left: 0;">
<?php 
	foreach ($products as $product) {
		$avgPrice = $product->getAveragePrice();
		$offers = $product->getOffers();
		?>
	<li style="padding-top: 0.7em;">
		<?php if($product->getImage()){ ?>
			<img src="<?php print $product->getImage(); ?>" 
			style="max-width: 160px; max-height: 160px; margin-top: 1em;" 
			alt="<?php print $offer['title'].' ('.$offer['brand'].')'; ?>" 
			title="<?php print $offer['title'].' ('.$offer['brand'].')'; ?>" /><br />
		<?php } ?>
		<a href="<?php print $this->url(array('controller'=>'product',
		'id'=>$product->getUniqueName())); ?>?format=mobile"><?php print $product->name; ?></a>
		<?php if($product->getManufacturer()){ ?>von <a href="<?php 
		print $this->url(array('controller'=>'manufacturer',
		'id'=>$product->getManufacturer()->getUniqueName())); ?>?format=mobile"><?php 
		print $product->getManufacturer()->name; ?></a><?php } ?> 
		(<?php print str_replace('.',',',round($product->size,2)).'&nbsp;'.
		$product->unit;?>) <?php  print (count($offers)>0 ? 'gibt es '.($avgPrice ? 'für durchschnittlich '.
		number_format($avgPrice,2,',','.').'&nbsp;€ ' : '').'<br />' : ''); ?>
	</li>
	<?php } ?>
</ul>
<?php } ?>
</div>
<?php }  ?>
</div>